Auto merge of #5464 - ehuss:restore-example-test, r=alexcrichton
authorbors <bors@rust-lang.org>
Thu, 3 May 2018 13:43:38 +0000 (13:43 +0000)
committerbors <bors@rust-lang.org>
Thu, 3 May 2018 13:43:38 +0000 (13:43 +0000)
commit4dc5db2db5603b926467996ccdfc8262506a2010
treea359e2ede3ca69de9639da103c7b69ad918668a9
parent66b0ffa81c560be1b79511b51f49cbb23bc78651
parentdffc5baeb2c9374a82dc81a2fc6e94b7c9c5fd83
Auto merge of #5464 - ehuss:restore-example-test, r=alexcrichton

Partially revert change to testing examples.

Fixes #5437

I don't think changing the behavior was quite the correct thing to do.  This new behavior is very similar to the old with a few small differences:

```
cargo test
    ORGINAL: Only builds examples.
    NEW: Builds all examples.  Any example with `test` set is tested.

cargo test --tests
    ORIGINAL: Runs all examples as tests.
    NEW: Only runs examples as tests if `test` is set.

cargo test --examples
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)

cargo test --example foo
    ORIGINAL: Runs the given example as a test.
    NEW: (SAME)

cargo test --all-targets
    ORIGINAL: Runs all examples as tests.
    NEW: (SAME)
```